<?php

namespace App\Http\Requests\Admin\Admin;

use Illuminate\Foundation\Http\FormRequest;

class AdminUpdate extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * 定义表单规则
     *
     * Date: 2018/06/08
     * @author Tenny
     * @return array
     */
    public function rules()
    {
        return [
            'password' => 'nullable|min:6|max:18',
        ];
    }

    /**
     * 定义错误响应消息
     *
     * Date: 2018/06/08
     * @author Tenny
     * @return array
     */
    public function messages()
    {
        return [
            'password.min' => '密码不得少于:min个字符',
            'password.max' => '密码不得超过:max个字符',
        ];
    }
}
